package cn.dapeng.time;

import java.util.Arrays;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

/**
 * @BelongProject study
 * @BelongPackage cn.dapeng.time
 * @Description TODO
 * @ClassName TimeTest
 * @Author xupen
 * @Date 2024/8/1 16:24
 * @Version 1.0.0
 */
public class TimeTest {

    private static final long MIN_TIMEOUT_NANOS = TimeUnit.MILLISECONDS.toNanos(1);

    public static void main(String[] args) {
        System.out.println(MIN_TIMEOUT_NANOS);
        System.out.println(Math.max(TimeUnit.SECONDS.toNanos(120), MIN_TIMEOUT_NANOS));
        // 排序
        String[] str = new String[] {"1", "abc", "b", "de", "acd"};
        Arrays.sort(str, String::compareTo);
        Arrays.stream(str).forEach(System.out::println);

        //
        String value = null;
        Optional<String> optional = Optional.ofNullable(value);
        System.out.println(optional.orElse(null));

    }



}
